package com.designpattern.builder.traditional;

/**
 * @author Liusr
 * @date 2023/3/30
 * @package com.designpattern.builder.traditional
 * @Description:
 */
public class Client {
	public static void main(String[] args) {
		//先生成一个director，然后生成一个目标builder，接着使用director组装builder，组装完毕后使用builder创建产品实例
		CarDirector director = new CarDirector();
		CarBuilder builder = new BMWCar("partA","partB");
		director.makeCar(builder);
		Car BMWCar = builder.getCar();
		System.out.println(BMWCar.toString());

		CarBuilder benzBuilder = new BenzCar("partA","partB");
		director.makeCar(benzBuilder);
		Car benzBuilderCar = benzBuilder.getCar();
		System.out.println(benzBuilderCar.toString());

	}
}
